<?php

include("global.php");

$pagetitle=" - Administration - Storage";
$links=" > Administration > Storage";

include ("header.php");

include ("admin_header.php");

if($userloggedinarray[15]!=="administrator"){
	$tplcontent['notice']="Must be logged in as administrator to use control panel!";
	echo template('notice',$tplcontent);
}else{

 if(!$editconfig){
 unset($tplcontent);

 $tplcontent['formheader'].="<form action=\"admin_storage.php\" method=post>";
 $tplcontent['formheader'].="<input type=hidden name=\"editconfig\" value=\"1\" size=40>";
 $tplcontent['usersdata'].="<input type=text name=\"usersdir\" value=\"$configarray[1]\" size=40 class=\"forminput\">";
 $tplcontent['forumsdata'].="<input type=text name=\"forumsdir\" value=\"$configarray[2]\" size=40 class=\"forminput\">";
 $tplcontent['customdata'].="<input type=text name=\"customdir\" value=\"$configarray[5]\" size=40 class=\"forminput\">";
 $tplcontent['modulesdata'].="<input type=text name=\"modulesdatadir\" value=\"$configarray[20]\" size=40 class=\"forminput\">";
 $tplcontent['submitbutton'].="<input type=submit name=\"submit\" value=\"Update\" class=\"formbutton\">";
 $tplcontent['formfooter'].="</form>";
 
 echo template('adminstorage',$tplcontent);
 }

 if($editconfig){

 writedata("$maindatadir/config.php",$usersdir,1);
 writedata("$maindatadir/config.php",$forumsdir,2);
 writedata("$maindatadir/config.php",$customdir,5);
 writedata("$maindatadir/config.php",$modulesdatadir,20);

 $tplcontent['notice']="Storagle locations updated!<br>";
 $tplcontent['notice'].="Changes will be seen on next page you load";
 echo template('notice',$tplcontent);
 }

}
include("admin_footer.php");

include("footer.php");

?>
